#ifndef UDPLISTENERTHREAD_H
#define UDPLISTENERTHREAD_H

#include <QThread>
#include <QUdpSocket>
#include <QHostAddress>

class UdpListenerThread : public QThread
{
    Q_OBJECT

public:
    explicit UdpListenerThread(quint16 port, QObject* parent = nullptr);
    void startListening();
    void stopListening();

signals:
    void commandReceived(const QString& command);
    void statusMessage(const QString& message);

protected:
    void run() override;

private:
    QUdpSocket* udpSocket;
    quint16 port;
    bool isRunning;
};

#endif // UDPLISTENERTHREAD_H
